#ifndef __MARS_GRAPHICS_SPOTLIGHT_H__
#define __MARS_GRAPHICS_SPOTLIGHT_H__

#include "MarsLight.h"

namespace Graphics
{

class SpotLight : public Light
{
public:
									SpotLight( const XMFLOAT3& position = XMFLOAT3( 0.0f, 0.0f, 0.0f ), 
											   const XMFLOAT3& direction = XMFLOAT3( 0.0f, 0.0f, 0.0f ),
											   float fAttenuation = 0.0f,
											   float fConeHalfAngleMax = 0.0f,
											   const XMFLOAT4& ambient = XMFLOAT4( 1.0f, 1.0f, 1.0f, 1.0f ), 
											   const XMFLOAT4& diffuse = XMFLOAT4( 1.0f, 1.0f, 1.0f, 1.0f ), 
											   const XMFLOAT4& specular = XMFLOAT4( 1.0f, 1.0f, 1.0f, 1.0f ) );
	virtual							~SpotLight();

	void							SetPosition( const XMFLOAT3& position );
	void							SetDirection( const XMFLOAT3& direction );
	void							SetAttenuation( float fAttenuation );
	void							SetConeAngle( float fConeAngle );

	const XMFLOAT3&					GetPosition() const;
	const XMFLOAT3&					GetDirection() const;
	float							GetAttenuation() const;
	float							GetConeAngle() const;

private:
	float							m_fAttenuation;
	float							m_fConeHalfAngleMax;
};

inline SpotLight::SpotLight( const XMFLOAT3& position, 
							 const XMFLOAT3& direction,
							 float fAttenuation,
							 float fConeHalfAngleMax,
							 const XMFLOAT4& ambient, 
							 const XMFLOAT4& diffuse, 
							 const XMFLOAT4& specular )
	: Light( Light::LT_SpotLight, ambient, diffuse, specular )
	, m_position( position )
	, direction( direction )
	, m_fAttenuation( fAttenuation )
	, m_fConeHalfAngleMax( fConeHalfAngleMax )
{

}

inline SpotLight::~SpotLight()
{

}

void SpotLight::SetPosition( const XMFLOAT3& position )
{
	m_position = position;
}

void SpotLight::SetDirection( const XMFLOAT3& direction )
{
	m_direction = direction;
}

void SpotLight::SetAttenuation( float fAttenuation )
{
	m_fAttenuation = fAttenuation;
}

void SpotLight::SetConeAngle( float fConeAngle )
{
	m_fConeHalfAngleMax = fConeAngle;
}

const XMFLOAT3& SpotLight::GetPosition() const
{
	return m_position;
}

const XMFLOAT3& SpotLight::GetDirection() const
{
	return m_direction;
}

float SpotLight::GetAttenuation() const
{
	return m_fAttenuation;
}

float SpotLight::GetConeAngle() const
{
	return m_fConeHalfAngleMax;
}

} // end of namespace Graphics

#endif // end of #ifndef __MARS_GRAPHICS_SPOTLIGHT_H__